package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static com.zzyl.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/member/orders")
@Api(tags = "服务项接口")
public class MemberOrdersController extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;


    @GetMapping("/project/page")
    @ApiOperation(value = "分页查询项目列表")
    public TableDataInfo<List<NursingProject>> list(NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    @GetMapping("/project/{id}")
    @ApiOperation(value = "根据编号查询护理项目信息")
    public AjaxResult getInfo(@PathVariable Long id)
    {
        return AjaxResult.success(nursingProjectService.selectNursingProjectById(id));
    }
}
